package intelligentcity.cities;

import intelligentcity.conf.Conf;
import intelligentcity.model.CityBuilder;
import intelligentcity.model.intersections.Intersection;
import intelligentcity.model.streets.HorizontalStreet;
import intelligentcity.model.streets.VerticalStreet;
import intelligentcity.system.LightsLearnedByRatio;

public class Dallas2CityBuilder extends CityBuilder {

    public Dallas2CityBuilder() {
        super();

        leftBorderOfTraffic = 5;
        rightBorderOfTraffic = 915;
        upperBorderOfTraffic = 5;
        lowerBorderOfTraffic = 795;

        addStreet(new HorizontalStreet(0, 400, 140, Conf.MAIN));

        addStreet(new VerticalStreet(180, 0, 360));
        Intersection int1 = new Intersection(new VerticalStreet(180, 360, 480), new HorizontalStreet(140, 400, 260));
        addIntersection(int1);
        addStreet(new VerticalStreet(180, 480, 800));

        addStreet(new HorizontalStreet(260, 400, 400));

        addStreet(new VerticalStreet(440, 0, 360));
        Intersection int2 = new Intersection(new VerticalStreet(440, 360, 480), new HorizontalStreet(400, 400, 520));
        addIntersection(int2);
        addStreet(new VerticalStreet(440, 480, 800));

        addStreet(new HorizontalStreet(520, 400, 660));

        addStreet(new VerticalStreet(700, 0, 360));
        Intersection int3 = new Intersection(new VerticalStreet(700, 360, 480), new HorizontalStreet(660, 400, 780));
        addIntersection(int3);
        addStreet(new VerticalStreet(700, 480, 800));

        addStreet(new HorizontalStreet(780, 400, 920, Conf.MAIN));

        int1.setLights(new LightsLearnedByRatio());
        int2.setLights(new LightsLearnedByRatio());
        int3.setLights(new LightsLearnedByRatio());

    }

}
